package org.baojie.raft.message;

import org.baojie.raft.message.info.MessageInfo;

import java.io.Serializable;

public class HeartBeatPong extends MessageInfo implements Serializable {

    private static final long serialVersionUID = 3381631656761725627L;

    private boolean success = false;
    private int term = 0;

    public HeartBeatPong() {

    }

    @Override
    public Type type() {
        return Type.Pong;
    }

    public int getTerm() {
        return term;
    }

    public void setTerm(int term) {
        this.term = term;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    @Override
    public String toString() {
        return "HeartBeatPong{" +
                ", term=" + term +
                ", success=" + success +
                '}';
    }

}
